package com.kimwu.design.interpreter.impl;

import com.kimwu.design.interpreter.Expression;

/**
 * 减号
 */
public class MinusExpression implements Expression {
 
    private Expression leftExpression;
    private Expression rightExpression;
 
    public MinusExpression(Expression leftExpression, Expression rightExpression) {
        this.leftExpression = leftExpression;
        this.rightExpression = rightExpression;
    }
 
    @Override
    public int interpret() {
        return leftExpression.interpret() - rightExpression.interpret();
    }
 
    @Override
    public String toString() {
        return "-";
    }
 
}